package com.tinycloud.miracll.product.service.impl;


import com.tinycloud.common.core.utils.DateUtils;
import com.tinycloud.common.datasource.annotation.Slave1;
import com.tinycloud.miracll.product.domain.ErpProductProdOrder;
import com.tinycloud.miracll.product.mapper.ErpProductProdOrderMapper;
import com.tinycloud.miracll.product.service.IErpProductProdOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 生产指令Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-26
 */
@Service
@Slave1
public class ErpProductProdOrderServiceImpl implements IErpProductProdOrderService
{
    @Autowired
    private ErpProductProdOrderMapper erpProductProdOrderMapper;

    /**
     * 查询生产指令
     *
     * @param createTime 生产指令ID
     * @return 生产指令
     */
    @Override
    public ErpProductProdOrder selectErpProductProdOrderById(Date createTime)
    {
        return erpProductProdOrderMapper.selectErpProductProdOrderById(createTime);
    }

    /**
     * 查询生产指令列表
     * 
     * @param erpProductProdOrder 生产指令
     * @return 生产指令
     */
    @Override
    public List<ErpProductProdOrder> selectErpProductProdOrderList(ErpProductProdOrder erpProductProdOrder)
    {
        return erpProductProdOrderMapper.selectErpProductProdOrderList(erpProductProdOrder);
    }

    /**
     * 新增生产指令
     * 
     * @param erpProductProdOrder 生产指令
     * @return 结果
     */
    @Override
    public int insertErpProductProdOrder(ErpProductProdOrder erpProductProdOrder)
    {
        erpProductProdOrder.setCreateTime(DateUtils.getNowDate());
        return erpProductProdOrderMapper.insertErpProductProdOrder(erpProductProdOrder);
    }

    /**
     * 修改生产指令
     * 
     * @param erpProductProdOrder 生产指令
     * @return 结果
     */
    @Override
    public int updateErpProductProdOrder(ErpProductProdOrder erpProductProdOrder)
    {
        return erpProductProdOrderMapper.updateErpProductProdOrder(erpProductProdOrder);
    }

    /**
     * 批量删除生产指令
     * 
     * @param createTimes 需要删除的生产指令ID
     * @return 结果
     */
    @Override
    public int deleteErpProductProdOrderByIds(Date[] createTimes)
    {
        return erpProductProdOrderMapper.deleteErpProductProdOrderByIds(createTimes);
    }

    /**
     * 删除生产指令信息
     * 
     * @param createTime 生产指令ID
     * @return 结果
     */
    @Override
    public int deleteErpProductProdOrderById(Date createTime)
    {
        return erpProductProdOrderMapper.deleteErpProductProdOrderById(createTime);
    }
}
